package com.fanfan.SmartPensionSystembackend.service.impl;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fanfan.SmartPensionSystembackend.entity.Activity;
import com.fanfan.SmartPensionSystembackend.mapper.ActivityMapper;
import com.fanfan.SmartPensionSystembackend.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description ActivityServiceImpl
 * @Author Guangdi Chen
 * @Date 2025-03-23
 */
@Service
public class ActivityServiceImpl implements ActivityService {
    @Autowired
    private ActivityMapper ActivityMapper;

    // 添加活动
    @Override
    public boolean addActivity(Activity activity) {
        return ActivityMapper.insertActivity(activity);
    }

    // 获取活动列表
    @Override
    public List<Activity> getAllActivity() {
        return ActivityMapper.getAllActivity();
    }

    // 通过审核
    @Override
    public boolean updateStatus(String activityId, String status) {
        return ActivityMapper.updateStatus(activityId, status);
    }

    // 驳回审核
    @Override
    public boolean rejectStatus(String activityId, String status, String rejectReason) {
        return ActivityMapper.rejectStatus(activityId, status, rejectReason);
    }

    // 根据活动筛选活动
    @Override
    public List<Activity> getActivityListByStatus(String status) {
        return ActivityMapper.getActivityListByStatus(status);
    }
}
